﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Assets.AnimationPlayer.Scripts.Util;
using UnityEngine;

namespace Assets.AnimationPlayer.Scripts.UI.controls
{
    public class MainContentControl:MonoBehaviour
    {
        public GameObject BtnLeft;
        public GameObject BtnRight;
        public GameObject BtnLeftArrow;
        public GameObject BtnRightArrow;
        public AnimationItem AnimationItem;

        public GameObject NoneContentView;

        private YioksCallBack.CallBackOneString _callBackClick;
        public void BindEvents(YioksCallBack.CallBackOneString callBack)
        {
            _callBackClick = callBack;
            YioksTriggerListener.Get(BtnLeft).OnClick = delegate {
                _callBackClick("left");
            };
            YioksTriggerListener.Get(BtnLeftArrow).OnClick = delegate {
                _callBackClick("left");
            };
            YioksTriggerListener.Get(BtnRight).OnClick = delegate {
                _callBackClick("right");
            };
            YioksTriggerListener.Get(BtnRightArrow).OnClick = delegate {
                _callBackClick("right");
            };
            YioksTriggerListener.Get(AnimationItem.gameObject).OnClick = delegate {
                _callBackClick(AnimationItem.Index.ToString());
            };
        }
    }
}
